<template>
  <div>
    <ZgEdit
      ref="dialog"
      :columns="columns"
      :formulas="formulas"
      :param="param"
      validUrl=""
      saveUrl="/zg-autoflow/autoFlow/step/add">
    </ZgEdit>
  </div>
</template>
<script>

const processPerson = [
  { name: '1407994149180936192', value: '张晓波' },
  { name: '1864926877955383297', value: '张晓波' }
]
export default {

  data () {
    return {
      param: {
        flowId: ''
      },
      columns: [
        { name: '环节名称', code: 'stepName', compType: '单行文本', isNeed: false, offset: 0, span: 24, defaultVal: '数量单制单' },
        // { name: '是否配置', code: 'formType', compType: '下拉选择', isNeed: false, offset: 0, span: 24, defaultVal: 'flowIsConfig' },
        { name: '环节编号', code: 'stepNo', compType: '单行文本', isNeed: false, offset: 0, span: 24, defaultVal: '00' },
        { name: '表单名称', code: 'stepFormName', compType: '单行文本', isNeed: false, offset: 0, span: 12, defaultVal: '1' },
        { name: '处理人', code: 'stepHandler', compType: '下拉选择', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 下拉选项: processPerson } },
        { name: '下个环节', code: 'nextStepId', compType: '单行文本', isNeed: false, offset: 0, span: 12, defaultVal: '1' },
        { name: '单签会签', code: 'approveType', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowApproveType' } },
        { name: '模式', code: 'selectHandlerMode', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowHandlerMode' } },
        { name: '可编辑', code: 'isEdit', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowIsConfig' } },
        { name: '必须盖章', code: 'isSeal', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowIsConfig' } },
        { name: '可退回', code: 'isReturn', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowIsConfig' } },
        { name: '可被退回', code: 'isReturned', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowIsConfig' } },
        { name: '退回审批', code: 'isBackApproval', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowIsConfig' } },
        { name: 'APP是否可操作', code: 'canApp', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '1', extra: { 字典类型: 'flowIsConfig' } },
        { name: '是否结束环节', code: 'isStepEnd', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '所属发票', code: 'billStep', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowBillStep' } },
        { name: '是否发送短信', code: 'shortMessage', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '短信的模板标题', code: 'shortMessageType', compType: '单行文本', isNeed: false, offset: 0, span: 12, defaultVal: '' },
        { name: '环节参数', code: 'stepParameter', compType: '单行文本', isNeed: false, offset: 0, span: 12, defaultVal: '' },
        { name: '主体', code: 'zt', compType: '单行文本', isNeed: false, offset: 0, span: 12, defaultVal: '' }
      ],
      formulas: [
        { triggerMode: '初始化时', name: '公式1', content: 'console.log("init");' },
        { triggerMode: '数据变化时', name: '公式2', content: 'console.log("update");' },
        { triggerMode: '提交时', name: '公式3', content: 'console.log("submit");' }
      ]
    }
  },
  methods: {
    open (id) {
      console.log(typeof id)
      this.param.flowId = id
      this.$refs.dialog.open()
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
